<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .cls{
            color:red;
        }
    </style>
</head>
<body>
    <div id="root"></div>
    <script src="https://unpkg.com/react@18/umd/react.development.js" crossorigin></script>
    <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js" crossorigin></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
    <script type="text/babel">

        // let h = React.createElement("h1",{title:"标题"},"标题");
        // let p = React.createElement("p",null,"段落");
        // let parent = React.createElement("div",null,h,p);

        let Hele = function(){
            return <h1>标题</h1>
        }
        let Pele = function(){
            let str = "hello";
            return <p className="cls">段落,{str}</p>;
        }
        let Parent = function(){
            let ary = [];
            for(let i = 0;i < 10;i++){
                ary.push(<Pele key={i}></Pele>);
            }
            console.log(ary)
            return <div>
                    <Hele></Hele>
                    {ary}     
                </div>;
        }
        
        ReactDOM.createRoot(document.getElementById("root")).render(<Parent />);
    </script>
</body>
</html>